package hittegods.gui;

import hittegods.classes.Item;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.JButton;
import javax.swing.JDialog;

public class ResultDialog extends JDialog {

    private Item[] items;

    public void parseInfo(Item[] items) {
        setLayout(null);
        this.items = items;
        setBounds(400, 100, getWidth(), getHeight());
        setSize(500, 500);
        init();
    }

    private void init() {
        JButton button = new JButton("Luk vinduet");
        button.addMouseListener(new MouseListener() {

            @Override
            public void mouseClicked(MouseEvent e) {
            }

            @Override
            public void mousePressed(MouseEvent e) {
                dispose();
            }

            @Override
            public void mouseReleased(MouseEvent e) {
            }

            @Override
            public void mouseEntered(MouseEvent e) {
            }

            @Override
            public void mouseExited(MouseEvent e) {
            }
        });

        button.setBounds(25, 5, 125, 25);
        add(button);

        resultElementPnl pnl = new resultElementPnl(items);
        pnl.setSize(500, 300);
        pnl.setBounds(2, 35, 500, 300);
        add(pnl);
    }
}
